﻿using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Elio.Interfaces;
using Elio.Sessions;
using System.Collections.ObjectModel;

namespace Elio.ViewModels;

public partial class ElegantPageViewModel : ObservableObject, IElegantPage
{
    private readonly ActivitySession _session;

    [ObservableProperty]
    private string _title = "Elio";
    [ObservableProperty]
    private ObservableCollection<View> _views = new();
    public Size? PageSize { get; set; }

    public ElegantPageViewModel(ActivitySession session)
    {
        this._session = session;
        session.ElegantPage = this;
    }

    [RelayCommand]
    private async Task OnLoaded() => await _session.Connect();

    [RelayCommand]
    private async Task OnBack() => await _session.GoBack();
}

